import { createRouter, createWebHistory } from 'vue-router'

import SettingsView from "@/views/SettingsView.vue";
import InitView from "@/views/InitView.vue";
import TaskView from "@/views/TaskView.vue";

// 可视化大屏界面按需加载
const BigScreenView = () => import('@/views/BigScreenView.vue');

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/setting',
      name: 'setting',
      component: SettingsView,
    },
    {
      path: '/',
      name: 'init',
      component: InitView
    },
    {
      path: '/task',
      name: 'task',
      component: TaskView
    },
    {
      path: '/task/detail/:id',
      name: 'task-detail',
      component: () => import('@/views/TaskDetailView.vue')
    },
    {
      path: '/task/execute/:id',
      name: 'task-execute',
      component: () => import('@/views/TaskExecuteView.vue')
    },
    {
      path: '/dashboard',
      name: 'dashboard',
      component: BigScreenView,
    }
  ],
})

export default router
